package main

import (
	"fmt"
	"path/filepath"
)

func main() {
	//pattern:
	//	{ term }
	//term:
	//	'*'         matches any sequence of non-Separator characters
	//	'?'         matches any single non-Separator character
	//	'[' [ '^' ] { character-range } ']'
	//	            character class (must be non-empty)
	//	c           matches character c (c != '*', '?', '\\', '[')
	//	'\\' c      matches character c
	//
	//character-range:
	//	c           matches character c (c != '\\', '-', ']')
	//	'\\' c      matches character c
	//	lo '-' hi   matches character c for lo <= c <= hi

	fmt.Println("On Unix:")
	fmt.Println(filepath.Match("/home/catch/*", "/home/catch/foo"))
	fmt.Println(filepath.Match("/home/catch/*", "/home/catch/foo/bar"))
	fmt.Println(filepath.Match("/home/?opher", "/home/gopher"))
	fmt.Println(filepath.Match("/home/\\*", "/home/*"))
	//On Unix:
	//true <nil>
	//false <nil>
	//true <nil>
	//true <nil>
}
